package com.aplink.dellcommercial.network;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;

import com.aplink.dellcommercial.configuration.DellController;

public class NetworkConnectivityReceiver extends BroadcastReceiver {

    @Override
    public void onReceive( Context context, Intent intent ) {
        final boolean lostconnection = intent.getBooleanExtra(
                ConnectivityManager.EXTRA_NO_CONNECTIVITY, false );
        if ( lostconnection ) {
            DellController.setOnline( false );
        } else {
            DellController.setOnline( true );
        }
    }
}
